Connecting to the Reader

The rm.Login must be called first to perform any reader management functions.

In case of fixed readers, the login information such as user name, password and secured mode are required for performing login operation. The secure mode parameter specifies that whether the mode of communication is HTTP or HTTPS. Based on this parameter, the internal communication between the client and the reader uses the specified transport interface. If supported by the Reader, there is an option to override an existing login session using the ForceLogin option of LoginInfo. This is currently supported on FX 7400 Version 1.1.0 and higher.

The login Info is not required for the Hand held readers. But it is must to call the rm.Login method first prior to other reader management functions.

// create Reader management object instance

ReaderManagement rm = new ReaderManagement();

LoginInfo loginInfo = new LoginInfo();

loginInfo.HostName = m_pHostname;

loginInfo.UserName = "admin";

loginInfo.Password = "admin";

loginInfo.SecureMode = SECURE_MODE.HTTP;

// Login operation

try

{

    rm.Login(loginInfo, READER_TYPE.XR);

}

catch (OperationFailureException exception)

{

    Console.WriteLine("Login failed " + exception.Message);

}